package entity;
//分页
//当前页 currentpage
//页面大小 pagesize
//页集合  users
//总数据 totalCount
//总页数 totalpage

import java.util.List;

public class Page {
	private int currentpage;
	private int  pagesize;
	private int totalCount;
	private int totalpage;
	private List<Users> users;
	public Page(int currentpage, int pagesize, int totalCount, int totalpage, List<Users> users) {
		super();
		this.currentpage = currentpage;
		this.pagesize = pagesize;
		this.totalCount = totalCount;
		this.totalpage = totalpage;
		this.users = users;
	}
	public int getCurrentpage() {
		return currentpage;
	}
	public void setCurrentpage(int currentpage) {
		this.currentpage = currentpage;
	}
	public int getPagesize() {
		return pagesize;
	}
	public void setPagesize(int pagesize) {//务必先计算totalCount再计算pagesize，否则可能出现空指针异常
		this.pagesize = pagesize;
		this.totalpage=this.totalCount%this.pagesize==0?this.totalCount/this.pagesize:this.totalCount/this.pagesize+1;
	}
	public Page() {
		super();
	}
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
	public int getTotalpage() {
		return totalpage;
	}
	public void setTotalpage(int totalpage) {
		this.totalpage = totalpage;
	}
	public List<Users> getUsers() {
		return users;
	}
	public void setUsers(List<Users> users) {
		this.users = users;
	}
}
